#pragma once
#include "stdafx.h"

/**
Create Rgn from bitmap, the function will skip the color which is spefiected by the tpColor parameter.
the function combine the rgn and the get the destination rgn;

@param hBitmap	the handle of the bitmap.
@param tpColor	the color will be wipe out.
@return the handle of the rgn.
*/
HRGN CreateRgnFromBitmapWipeOutTransparentColor(HBITMAP hBitmap,COLORREF tpColor);

inline bool CompareRGBQuad(RGBQUAD rgbQuad1,RGBQUAD rgbQuad2);

inline bool CompareCOLORREF(COLORREF color1,COLORREF color2);

/**
This code is form internet 
My code is not work correct, in  the case of some details of bitmap
this code is very complex and inefficient
*/
HRGN BitmapToRegion (HBITMAP hBmp, COLORREF cTransparentColor =  0, COLORREF cTolerance = 0x101010);

/**
Zoom the region .
@param hRgn the handle of the region which to be zoomed.
@param zoomx the multiple in the horizontal direction.
@param zoomx the multiple int the vectical direction.
@return	return the handle the region which have been zoomed.
*/
HRGN ZoomRgn(HRGN hRgn , float zoomx, float zoomy);
